package com.tx.review.string_;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * StringTable的大小对性能的影响
 *
 *      -XX:+PrintStringTableStatistics -XX:StringTableSize=1009
 *      
 * @author ：tx
 * @version:
 */
public class StringTableSize {
    public static void main(String[] args) throws IOException {
        File file = new File("src/main/resources/hello.txt");
        try (BufferedReader reader = new BufferedReader(new FileReader(file)) ) {
            String line = null;
            long start = System.nanoTime();
            while (true) {
                line = reader.readLine();
                if (line == null) {
                    break;
                }
                line.intern();
            }
            System.out.println("耗时:" + (System.nanoTime() - start) / 1000000);
        }


        while (true){

        }

    }
}
